<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .wrap {
            width: 300px;
            height: 300px;
            margin: 100px auto;
            position: relative;
            transform-style: preserve-3d;
            transform: rotateX(0deg) rotateY(0deg);
        }

        .box {
            width: 300px;
            height: 300px;
            font-size: 50px;
            font-weight: 700px;
            text-align: center;
            line-height: 200px;
            position: absolute;
            left: 0;
            top: 0;
        }

        .box1 {
            background-color: red;
            transform: rotateY(180deg);
        }

        .box2 {
            background-color: bisque;
            transform-origin: top;
            transform: rotateX(90deg);
        }

        .box3 {
            background-color: blue;
            transform-origin: right;
            transform: rotateY(90deg);
        }

        .box4 {
            background-color: green;
            transform-origin: bottom;
            transform: rotateX(-90deg);
        }

        .box5 {
            background-color: yellow;
            transform-origin: left;
            transform: rotateY(-90deg);
        }

        .box6 {
            background-color: orange;
            transform: translateZ(200px);
        }
    </style>
</head>

<body>
    <div class="wrap">
        <div class="box box1">1</div>
        <div class="box box2">2</div>
        <div class="box box3">3</div>
        <div class="box box4">4</div>
        <div class="box box5">5</div>
        <div class="box box6">6</div>
    </div>
</body>

</html>